#print(ord('b'),chr(97))
def showbytes(b):
    print(b)
    print('----------------')
    for i in b:
        print('\\x{:x}'.format(i),end='')
def writeFile():
    bf = open('b1','bw')
    block = b'\x01\x02\x03\x04\x05'
    bf.write(block)
    bf.seek(1)
    bf.write(b'\x88')
    bf.close()
def readFile():
    bf = open('b1','br')
    #bf.seek(1)
    block = bf.read(2)
    #print(bf.tell())
    showbytes(block)
    bf.close()
if __name__ == '__main__':
    writeFile()
    readFile()
